window: clear move_focus when focus is already set
authorChristian Hergert <chergert@redhat.com>
Thu, 10 Jun 2021 21:01:41 +0000 (14:01 -0700)
committerChristian Hergert <chergert@redhat.com>
Thu, 10 Jun 2021 21:01:41 +0000 (14:01 -0700)
This can get set in other places, so we need to ensure it is cleared so
that an after-paint handler does not move the focus to a new widget.

gtk/gtkwindow.c

index 35ca93a4815b697b959ac4088369b99448a8567f..a79e1605820f5d4909d95a8eb82584886dc2ef81 100644 (file)
@@ -2024,7 +2024,10 @@ gtk_window_root_set_focus (GtkRoot   *root,
     return;
 
   if (focus == priv->focus_widget)
-    return;
+    {
+      priv->move_focus = FALSE;
+      return;
+    }
 
   if (priv->focus_widget)
     old_focus = g_object_ref (priv->focus_widget);